/**
 * 
 */
package com.golden.gamedev.engine.input;

import java.awt.Button;
import java.awt.Component;
import java.awt.image.VolatileImage;

import com.golden.gamedev.MockVolatileImage;

/**
 * The {@link MockComponent} class provides a mock implementation of the
 * {@link Component} class for testing purposes only.
 * 
 * @author MetroidFan2002
 * @version 1.0
 * @since 0.2.4
 * @see Button
 * @see Component
 * 
 */
public final class MockComponent extends Button {
	
	/**
	 * Serializable ID generated by Eclipse.
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * Whether or not the {@link #requestFocus()} method was invoked. Defaults
	 * to false.
	 */
	public boolean focusRequested = false;
	
	/**
	 * Whether or not the {@link #setFocusTraversalKeysEnabled(boolean)} method
	 * was invoked with an argument of true. Defaults to true.
	 */
	public boolean focusTraversalKeysEnabled = true;
	
	public void requestFocus() {
		super.requestFocus();
		this.focusRequested = true;
	}
	
	public void setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled) {
		super.setFocusTraversalKeysEnabled(focusTraversalKeysEnabled);
		this.focusTraversalKeysEnabled = focusTraversalKeysEnabled;
	}
	
	public VolatileImage createVolatileImage(int width, int height) {
		MockVolatileImage image = new MockVolatileImage();
		// TODO: if needed, set the width and height.
		return image;
	}
}
